
    <?php foreach ($this->posts as $post) { ?>
    <div class="post">
      <h2>
        <?php echo $post->get_header(); ?>
        <?php if($post->get_authorId() === $this->user->get_id()){?>
          <a href="index.php?controller=Post&action=Edit&postid=<?php echo $post->get_id(); ?>" class="btn btn-primary"><i class="icon icon-pencil icon-white"></i></a>
        <?php } ?>
      </h2>
      <?php echo $post->get_body();?>
      <div class="postInfo">
        <span class="author"><i class="icon icon-user"></i><?php echo $this->authorNames[$post->get_authorId()];?></span>
        <span><?php echo $post->get_createdOn();?></span>
      </div>
    </div>
    <?php } ?>
